import request from 'utils/request'

export function getUserInfo() {
  return request({
    url: '/user?include=permissions,profile',
    method: 'get'
  })
}

export function getUsers(query) {
  return request({
    url: '/users?include=roles,profile',
    method: 'get',
    params: query
  })
}

export function createUser(data) {
  return request({
    url: '/user?include=roles,profile',
    method: 'post',
    data
  })
}

export function updateUser(id, data) {
  return request({
    url: '/users/' + id + '?include=roles,profile',
    method: 'patch',
    data
  })
}

export function deleteUser(id) {
  return request({
    url: '/users/' + id,
    method: 'delete'
  })
}
